package dm71.espil.models;

import java.io.Serializable;

import org.json.JSONException;
import org.json.JSONObject;

public class User implements Serializable
{
	public int UserID;
	public String Username;
	public String Password;
	public String LastLogin;
	public String Name;
	public String LastName;
	public String Klasse;

	public JSONObject obj;

	public User(JSONObject obj)
	{
		try
		{
			UserID = obj.getInt("UserID");
			
		} catch (JSONException exception)
		{
			// TODO Auto-generated catch-block stub.
			exception.printStackTrace();
		}
		
		try
		{
			Username = obj.getString("Username");
			
		} catch (JSONException exception)
		{
			// TODO Auto-generated catch-block stub.
			exception.printStackTrace();
		}
		
		try
		{
			Password = obj.getString("Password");
			
		} catch (JSONException exception)
		{
			// TODO Auto-generated catch-block stub.
			exception.printStackTrace();
		}
		
		try
		{
			LastLogin = obj.getString("LastLogin");
			
		} catch (JSONException exception)
		{
			// TODO Auto-generated catch-block stub.
			exception.printStackTrace();
		}
		
		try
		{
			Name = obj.getString("Name");
			
		} catch (JSONException exception)
		{
			// TODO Auto-generated catch-block stub.
			exception.printStackTrace();
		}
		
		try
		{
			LastName = obj.getString("Lastname");
		} 
		catch (JSONException exception)
		{
			// TODO Auto-generated catch-block stub.
			exception.printStackTrace();
		}
		
		try
		{
			Klasse = obj.getString("Class");
		} 
		catch (JSONException exception)
		{
			// TODO Auto-generated catch-block stub.
			exception.printStackTrace();
		}
	}

	public User()
	{

	}

	public User(int id)
	{
		this.UserID = id;
	}

	public void getFromJason()
	{

	}

	public int getUserID()
	{
		return UserID;
	}

	public String getUsername()
	{
		return Username;
	}

	public String getPassword()
	{
		return Password;
	}

	public String getLastLogin()
	{
		return LastLogin;
	}

	public String getName()
	{
		return Name;
	}

	public String getLastName()
	{
		return LastName;
	}

	public void setUserID(int userID)
	{
		UserID = userID;
	}

	public void setUsername(String username)
	{
		Username = username;
	}

	public void setPassword(String password)
	{
		Password = password;
	}

	public void setLastLogin(String lastLogin)
	{
		LastLogin = lastLogin;
	}

	public void setName(String name)
	{
		Name = name;
	}

	public void setLastName(String lastName)
	{
		LastName = lastName;
	}

	public String getKlasse()
	{
		return Klasse;
	}
}
